package cn.dujc.superkid.adapter;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.StrictMode;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import cn.dujc.core.adapter.BaseAdapter;
import cn.dujc.core.adapter.BaseViewHolder;
import cn.dujc.core.util.StringUtil;
import cn.dujc.core.util.ToastUtil;
import cn.dujc.superkid.R;
import cn.dujc.superkid.activities.InforUserActivity;
import cn.dujc.superkid.activities.MainActivity;
import cn.dujc.superkid.bean.MyClassResult;
import cn.dujc.superkid.utils.ImageLoadHelper;


public class MyCourseAdapter extends BaseAdapter<MyClassResult.MyClass> {

    public MyCourseAdapter(@Nullable List<MyClassResult.MyClass> data) {
        super(data);
        mLayoutResId = R.layout.item_course;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyClassResult.MyClass item) {
        ImageLoadHelper.loadImage((ImageView) helper.getView(R.id.item_iv_couse_image), item.getCover());
        helper.setText(R.id.item_tv_couse_title, item.getClass_title());
        helper.setText(R.id.item_tv_couse_info,"共有"+item.getCourse_num() +"节,已有"+item.getStudy_num()+"名学生学习");
    }
}